import {NgModule, ErrorHandler} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {IonicApp, IonicModule, IonicErrorHandler} from 'ionic-angular';
import {MyApp} from './app.component';

import {AboutPage} from '../pages/about/about';
import {ContactPage} from '../pages/contact/contact';
import {HomePage} from '../pages/home/home';
import {AuthPage} from '../pages/auth/auth';
import {AuthFacePage} from '../pages/auth-face/auth-face';
import {TabsPage} from '../pages/tabs/tabs';

import {StatusBar} from '@ionic-native/status-bar';
import {SplashScreen} from '@ionic-native/splash-screen';
import {Camera} from '@ionic-native/camera';
import {FileTransfer} from '@ionic-native/file-transfer';
import {Contacts} from '@ionic-native/contacts';
import {InAppBrowser} from '@ionic-native/in-app-browser';
import { ThemeableBrowser } from '@ionic-native/themeable-browser';

import {IonicStorageModule} from '@ionic/storage';
import {ComponentsModule} from '../components/components.module';

import {CONST} from '../common/const';
import {API} from '../common/api';
import {ControlsCheck} from '../common/controlsCheck';
import {HttpClientModule} from '@angular/common/http';
import {HttpProvider} from '../common/http';
import {LoginProvider} from '../providers/login/login';
import {ProductProvider} from '../providers/product/product';
import {AuthProvider} from '../providers/auth/auth';

@NgModule({
  declarations: [
    MyApp,
    AboutPage,
    ContactPage,
    AuthPage,
    AuthFacePage,
    HomePage,
    TabsPage
  ],
  imports: [
    BrowserModule,
    HttpClientModule,
    IonicModule.forRoot(MyApp, {
      backButtonIcon: 'ios-arrow-back',
      backButtonText: '',
      pageTransition: 'md-transition',
      activator: 'ripple',
      mode: 'md',
      tabsHideOnSubPages: true,
      platforms: {
        android: {
          // statusbarPadding: true
        }
      }
    }),
    ComponentsModule,
    IonicStorageModule.forRoot()
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    AboutPage,
    ContactPage,
    AuthPage,
    AuthFacePage,
    HomePage,
    TabsPage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    Camera,
    FileTransfer,
    InAppBrowser,
    ThemeableBrowser,
    Contacts,
    CONST,
    API,
    ControlsCheck,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    HttpProvider,
    LoginProvider,
    ProductProvider,
    AuthProvider,
  ]
})
export class AppModule {
}
